package cn.edu.ncu.housinghub.service;

import cn.edu.ncu.housinghub.dto.chat.ChatMessageDTO;
import cn.edu.ncu.housinghub.entity.chatsession.ChatMessage;
import cn.edu.ncu.housinghub.entity.chatsession.ChatSession;

import java.util.List;

public interface ChatService {
    // 创建或获取会话
    ChatSession getOrCreateSession(Long userId1, Long userId2, Long houseId);

    // 发送消息
    ChatMessage sendMessage(Long senderId, ChatMessageDTO messageDTO);

    // 获取会话消息
    List<ChatMessage> getSessionMessages(Long sessionId, int pageNum, int pageSize);

    // 获取用户会话列表
    List<ChatSession> getUserSessions(Long userId);

    // 标记消息为已读
    void markAsRead(Long sessionId, Long receiverId);

    // 获取未读消息数量
    int getUnreadCount(Long sessionId, Long receiverId);
}
